package gupao.concurrency.simpledemo.model;

import lombok.Data;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Data
public class BizProcessResult<T> {
    private UserInfo userInfo;
    private List<T> results;

    public static <R> BizProcessResult<R> create(UserInfo userInfo, R... rs){
        BizProcessResult<R> result = new BizProcessResult<R>();
        result.setUserInfo(userInfo);
        result.setResults(Stream.of(rs).collect(Collectors.toList()));
        return result;
    }
}
